package edu.sctu.zhengsenwen.month201506.day20150616;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by user15 on 2015/6/16.
 */
public class StreamFileReadOrWrite {


    public StreamFileReadOrWrite() throws IOException {

        FileInputStream fileInputStream = new FileInputStream("C://C19//222.jpeg");
        FileOutputStream fileOutputStream = new FileOutputStream("C://C19//2.jpeg");

        byte[] inOutbyte = new byte[fileInputStream.available()];


        fileInputStream.read(inOutbyte);
        fileOutputStream.write(inOutbyte);


        fileInputStream.close();
        fileOutputStream.close();
        System.out.println("成功创建 C://19//2.jpg 文件");

    }

    public static void main(String[] args) {

        try{

            new StreamFileReadOrWrite();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
